Learn GIS Programming with ArcGIS for Javascript API 4.x and ArcGIS Online: Learn GIS programming by building an engaging web map application works on mobile or the web by Hussein Nasser

Learn GIS Programming with ArcGIS for Javascript API 4.x and ArcGIS Online: Learn GIS programming by building an engaging web map application works on mobile or the web by Hussein Nasser

Author:Hussein Nasser [Nasser, Hussein]
Language: eng
Format: azw3
Published: 2018-11-16T16:00:00+00:00


...

const mapView = new MapView({

"container" : "divMapView",

"map" : map

})

alert(map.layers.length);

Save and run your code by accessing http://localhost:8080

At first, you might think this is little odd to get zero, we do have one layer called Landmarks. But if you really think about it, the alert code is executing BEFORE the map actually finished loading, this is back to our Promise discussion in chapter 2. We need to tell the map object, hey, whenever you are done, tell me how many layers do I have. How do we do that? Using promises.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.